import Vue from 'vue'
import VueRouter from 'vue-router'
//首页
import index from '../../page/index.vue';
//个人中心
import personalCenter from '../../page/personalCenter.vue';
//配送方式页面
import deliveryWay from '../../page/deliveryWay.vue';
//确定订单页面
import confirmOrder from '../../page/confirmOrder.vue';
//搜索商品列表
import searchProductList from '../../page/searchProductList.vue';
//搜索店铺列表
import searchStoreList from '../../page/searchStoreList.vue';
//新增地址
import addAddress from '../../page/addAddress.vue';
//付款结果成功页面
import paymentResultsSucceed from '../../page/paymentResultsSucceed.vue';
//付款结果提货码页面
import paymentResultsCode from '../../page/paymentResultsCode.vue';
//选择地址页面
import selectAddress from '../../page/selectAddress.vue';
//评论列表
import commentList from '../../page/commentList.vue';
//编辑地址
import editAddress from '../../page/editAddress.vue';
//商品详情页面
import commodityDetail from '../../page/commodityDetail.vue';
//商品分类
import classification from '../../page/classification.vue';
//品牌分类
import brandClassification from '../../page/brandClassification.vue';
//商品评价
import commodityEvaluate from '../../page/commodityEvaluate.vue';
//加入搭搭
import joinDada from '../../page/joinDada.vue';
//意见反馈
import feedback from '../../page/feedback.vue';
//搜索列表
import classificationList from '../../page/classificationList.vue';
//查看物流-商品列表
import logisticsProList from '../../page/logisticsProList.vue';
//查看物流
import viewLogistics from '../../page/viewLogistics.vue';
//登录
import login from '../../page/login.vue';
//我的收藏
import myCollect from '../../page/myCollect.vue';
//我的积分
import myIntegral from '../../page/myIntegral.vue';
//购物车
import shopCar from '../../page/shopCar.vue';
//加入搭搭
import join from '../../page/join.vue';
//提货码
import pickUpCode from '../../page/pickUpCode.vue';
//退换货记录
import changeOrRefund from '../../page/changeOrRefund.vue';
//申请售后
import applyForAfterSales from '../../page/applyForAfterSales.vue';
//申请售后类型
import applyForAfterSalesType from '../../page/applyForAfterSalesType.vue';
//推荐店铺
import recommendStore from '../../page/recommendStore.vue';
//店铺搜索
import storeSearch from '../../page/storeSearch.vue';
//我的订单
import myOrder from '../../page/myOrder.vue';
//售后反馈
import serviceFeedback from '../../page/serviceFeedback.vue';
//订单状态
import orderStatus from '../../page/orderStatus.vue';
//退货退款
import returnGoods from '../../page/returnGoods.vue';
//换货
import exchangeGoods from '../../page/exchangeGoods.vue';
//搜索
import search from '../../page/search.vue';
//定位搜索
import city from '../../page/city.vue';
//积分商城
import integralShoppingMall from '../../page/integralShoppingMall.vue';
//发表评价
import publishEvaluate from '../../page/publishEvaluate.vue';
//下载
import download from '../../page/download.vue';
// 试衣间
import fit from '../../page/fit.vue';
// 修改五官
import model from '../../page/model.vue';
// 活动专题
import activityPart from '../../page/activityPart.vue';
// 地图
import map from '../../page/map.vue';
// 积分商城详情页
import integralCommodityDetail from '../../page/integralCommodityDetail';
//routes
var routes = [
	{
        name: 'default',
        path: '/',
        component: index
    },
	{
		name:"index",
		path:"/index",
		component: index
	},
	{
		name:"personalCenter",
		path:"/personalCenter",
		component:personalCenter
	},
	{
		name:"deliveryWay",
		path:"/deliveryWay",
		component:deliveryWay
	},
	{
		name:"confirmOrder",
		path:"/confirmOrder",
		component:confirmOrder
	},
	{
		name:"searchProductList",
		path:"/searchProductList",
		component:searchProductList
	},
	{
		name:"searchStoreList",
		path:"/searchStoreList",
		component:searchStoreList
	},
	{
		name:"addAddress",
		path:"/addAddress",
		component: addAddress,
	},
	{
		name:"paymentResultsSucceed",
		path:"/paymentResultsSucceed",
		component:paymentResultsSucceed
	},
	{
		name:"paymentResultsCode",
		path:"/paymentResultsCode",
		component:paymentResultsCode
	},
	{
		name:"selectAddress",
		path:"/selectAddress",
		component:selectAddress
	},
	{
		name:"commentList",
		path:"/commentList",
		component:commentList
	},
	{	name: "editAddress",
		path: "/editAddress",
		component: editAddress,
	},
	{
		name:"commodityDetail",
		path:"/commodityDetail",
		component:commodityDetail
	},
	{
		name:"classification",
		path:"/classification",
		component:classification
	},
	{
		name:"brandClassification",
		path:"/brandClassification",
		component:brandClassification
	},
	{
		name:"commodityEvaluate",
		path:"/commodityEvaluate",
		component:commodityEvaluate
	},
	{
		name:"joinDada",
		path:"/joinDada",
		component:joinDada
	},
	{
		name:"feedback",
		path:"/feedback",
		component:feedback
	},
	{
		name:"classificationList",
		path:"/classificationList",
		component:classificationList
	},
	{
		name:"logisticsProList",
		path:"/logisticsProList",
		component:logisticsProList
	},
	{
		name:"viewLogistics",
		path:"/viewLogistics",
		component:viewLogistics
	},
	{
		name:"login",
		path:"/login",
		component:login
	},
	{
		name:"myCollect",
		path:"/myCollect",
		component:myCollect
	},
	{
		name:"myIntegral",
		path:"/myIntegral",
		component:myIntegral
	},
	{
		name:"shopCar",
		path:"/shopCar",
		component:shopCar
	},
	{
		name:"join",
		path:"/join",
		component:join
	},
	{
		name:"pickUpCode",
		path:"/pickUpCode",
		component:pickUpCode
	},
	{
		name:"changeOrRefund",
		path:"/changeOrRefund",
		component:changeOrRefund
	},
	{
		name:"applyForAfterSales",
		path:"/applyForAfterSales",
		component:applyForAfterSales
	},
	{
	  name: "applyForAfterSalesType",
	  path: "/applyForAfterSalesType",
	  component: applyForAfterSalesType
	},
	{ name:"recommendStore",
	  path:"/recommendStore",
	  component:recommendStore
	},
	{
	  name:"storeSearch",
	  path:"/storeSearch",
	  component:storeSearch
	},
	{
	  name:"myOrder",
	  path:"/myOrder",
	  component:myOrder
	},
	{
	  name:"serviceFeedback",
	  path:"/serviceFeedback",
	  component:serviceFeedback
	},
	{
	  name:"orderStatus",
	  path:"/orderStatus",
	  component:orderStatus
	},
	{
	  name:"returnGoods",
	  path:"/returnGoods",
	  component:returnGoods
	},
	{
	  name:"exchangeGoods",
	  path:"/exchangeGoods",
	  component:exchangeGoods
	},
	{
		name:"search",
		path:"/search",
		component:search
	},
	{
		name:"city",
		path:"/city",
		component:city
	},
	{
		name:"integralShoppingMall",
		path:"/integralShoppingMall",
		component:integralShoppingMall
	},
	{
		name:"publishEvaluate",
		path:"/publishEvaluate",
		component:publishEvaluate
	},
	{
		name:"download",
		path:"/download",
		component:download
	},
	{
		name:"fit",
		path:"/fit",
		component:fit
	},
	{
		name:"model",
		path:"/model",
		component:model
	},
	{
		name:"activityPart",
		path:"/activityPart",
		component:activityPart
	},
    {
      name:"map",
      path:"/map",
      component:map
    },
	{
		name:"integralCommodityDetail",
		path:"/integralCommodityDetail",
		component:integralCommodityDetail
	}
];

Vue.use(VueRouter);

//实例化
var router = new VueRouter({	
	routes
});

//回到顶部
router.beforeEach(function (to, from, next) {
	window.scrollTo(0, 0)
	next()
})

export default router;
